/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package carstore.userserver.models;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author wuhao
 */
@Entity
@Table(name = "user_info")
@XmlRootElement
@NamedQueries({
	@NamedQuery(name = "UserInfo.findAll", query = "SELECT u FROM UserInfo u"),
	@NamedQuery(name = "UserInfo.findById", query = "SELECT u FROM UserInfo u WHERE u.id = :id")})
public class UserInfo implements Serializable {

	private static final long serialVersionUID = 1L;
	@Id
        @GeneratedValue(strategy = GenerationType.IDENTITY)
        @Basic(optional = false)
        @Column(name = "ID")
	private Integer id;
        @Column(name = "USER_ID")
	private Integer userId;
        @Column(name = "car_ID")
	private Integer carID;

        @Column(name="selected")
        private Boolean selected;
	public UserInfo() {
	}

	public UserInfo(Integer id) {
		this.id = id;
	}

	public Boolean getSelected()
	{return selected;}
	
	public void setSelected(Boolean selected)
	{
		this.selected =selected;
	}
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public Integer getUserId() {
		return userId;
	}

	public void setUserId(Integer userId) {
		this.userId = userId;
	}

	public Integer getCarID() {
		return carID;
	}

	public void setCarID(Integer carID) {
		this.carID = carID;
	}

	@Override
	public int hashCode() {
		int hash = 0;
		hash += (id != null ? id.hashCode() : 0);
		return hash;
	}

	@Override
	public boolean equals(Object object) {
		// TODO: Warning - this method won't work in the case the id fields are not set
		if (!(object instanceof UserInfo)) {
			return false;
		}
		UserInfo other = (UserInfo) object;
		if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
			return false;
		}
		return true;
	}

	@Override
	public String toString() {
		return "carstore.orderserver.models.UserInfo[ id=" + id + " ]";
	}
	
}
